﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Practices.Prism.Logging;

namespace AesonPrismMonoProject.Logger
{
    public class AesonPrismLogger : ILoggerFacade
    {
        public void LogException(Exception exc)
        {
            Log(exc.ToString(), Category.Exception, Priority.High);
        }
        public void Log(string message, Category category, Priority priority)
        {
            var sb = new StringBuilder();
            sb.AppendLine("----------------------------------------------------------------------------------------");
            sb.AppendLine("Heure : " + DateTime.Now + "    Categorie : " + category + "     Prioritée : " + priority);
            sb.AppendLine("Message : ");
            sb.AppendLine(message);
            Console.WriteLine(sb.ToString());
            if (priority == Priority.Medium || priority == Priority.High)
            {
                //Send to backend
            }

        }
    }
}
